package com.treasure.mall.biz.service.core.order;

import com.treasure.mall.biz.base.SearchableCrudService;
import com.treasure.mall.biz.entity.order.OrderItemPO;
import com.treasure.mall.biz.entity.order.RebateBillPO;
import com.treasure.mall.biz.entity.user.UserPO;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * @author allan
 * @version 1.0.0
 * @date 2020/7/23
 */
public interface RebateBillService extends SearchableCrudService<RebateBillPO, String> {
    RebateBillPO create(OrderItemPO orderItemPO, UserPO userPO, int levelDepth);

    List<RebateBillPO> findByOrderItem(Long orderItemId);

    List<RebateBillPO> findBySubOrder(String subOrderId);

    @Transactional
    void convert(RebateBillPO po);

    List<RebateBillPO> findToConvert();

    void modifyInvalidate(Long orderItemId, boolean invalidate);
}
